package com.system.vote.admin.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.system.vote.common.utils.CustomDateTimeSerializer;
import lombok.Data;
import java.util.List;
/**
 * 投票表
 * @TableName t_vote
 */
@TableName(value ="t_vote")
@Data
public class TVote implements Serializable {
    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 标题
     */
    @TableField(value = "title")
    private String title;

    /**
     * 说明
     */
    @TableField(value = "explanation")
    private String explanation;

    /**
     * 投票封面
     */
    @TableField(value = "cover_image")
    private String coverImage;

    /**
     * 投票结束时间
     */
//    @JsonSerialize(using = CustomDateTimeSerializer.class)
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "vote_end_time")
    private String voteEndTime;

    /**
     * 创建人微信ID
     */
    @TableField(value = "openid")
    private String openid;

    /**
     * 投票类型
     */
    @TableField(value = "type")
    private Integer type=1;

    /**
     * 创建人ID
     */
    @TableField(value = "userid")
    private Long userid;

    /**
     * 投票结束时间
     */
    @JsonSerialize(using = CustomDateTimeSerializer.class)
   @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 投票栏目状态
     */
    @TableField(value = "status")
    private String status;

    @TableField(exist = false)
    private List<TVoteItem> items=new ArrayList<>();

    @TableField(exist = false)
    private TWxUserinfo tWxUserinfo;

    @TableField(exist = false)
    private List<TVoteDetail> tVoteDetailList=new ArrayList<>();

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}